import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import legacy from '@vitejs/plugin-legacy'
import { resolve } from "path"
// import styleImport, { VantResolve } from 'vite-plugin-style-import'
// https://vitejs.dev/config/
export default defineConfig({
  base: "./",
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src")
    }
  },
  server: {
    host: "127.0.0.1",
    port: 3030,
    open: true
  },
  plugins: [
    // styleImport({
    //   resolves: [VantResolve()]
    // }),
    vue(),
    legacy({
      targets: ['ie >= 11'],
      additionalLegacyPolyfills: ['regenerator-runtime/runtime']
    }),
  ],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData:`@import"./src/assets/css/global.scss";`
      }
    }
  }
})
